{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 317,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv(\"raw_data.csv\", index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 318,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(\"raw_data.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import MinMaxScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import PowerTransformer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import QuantileTransformer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sample_index\n",
       "1      1.38\n",
       "2      1.18\n",
       "3      1.38\n",
       "4      1.38\n",
       "5      1.28\n",
       "       ... \n",
       "321    1.15\n",
       "322    1.25\n",
       "323    1.35\n",
       "324    1.28\n",
       "325    1.25\n",
       "Name: RON损失\\n（不是变量）, Length: 325, dtype: float64"
      ]
     },
     "execution_count": 190,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = df[\"RON损失\\n（不是变量）\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_ = df.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = X_.pop(\"RON损失\\n（不是变量）\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sample_index\n",
       "1      2020/5/26 8:00:00\n",
       "2      2020/5/21 8:00:00\n",
       "3      2020/5/19 8:00:00\n",
       "4      2020/5/14 8:00:00\n",
       "5      2020/5/12 8:00:00\n",
       "             ...        \n",
       "321    2017/4/26 8:00:00\n",
       "322    2017/4/24 8:00:00\n",
       "323    2017/4/21 8:00:00\n",
       "324    2017/4/19 8:00:00\n",
       "325    2017/4/17 8:00:00\n",
       "Name: time, Length: 325, dtype: object"
      ]
     },
     "execution_count": 194,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_.pop(\"time\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = X_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.pipeline import Pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.decomposition import PCA, FastICA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 229,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import Ridge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting lightgbm\n",
      "  Downloading lightgbm-3.0.0-py2.py3-none-win_amd64.whl (737 kB)\n",
      "Requirement already satisfied: numpy in c:\\software\\miniconda3\\lib\\site-packages (from lightgbm) (1.19.1)\n",
      "Requirement already satisfied: scipy in c:\\software\\miniconda3\\lib\\site-packages (from lightgbm) (1.5.2)\n",
      "Requirement already satisfied: scikit-learn!=0.22.0 in c:\\software\\miniconda3\\lib\\site-packages (from lightgbm) (0.23.2)\n",
      "Requirement already satisfied: threadpoolctl>=2.0.0 in c:\\software\\miniconda3\\lib\\site-packages (from scikit-learn!=0.22.0->lightgbm) (2.1.0)\n",
      "Requirement already satisfied: joblib>=0.11 in c:\\software\\miniconda3\\lib\\site-packages (from scikit-learn!=0.22.0->lightgbm) (0.16.0)\n",
      "Installing collected packages: lightgbm\n",
      "Successfully installed lightgbm-3.0.0\n"
     ]
    }
   ],
   "source": [
    "!pip install lightgbm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import KFold, train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = X.astype(float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 223,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = y.astype(float).to_numpy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 224,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "     X, y, test_size=0.33, random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 228,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('float64')"
      ]
     },
     "execution_count": 228,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_train.dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 261,
   "metadata": {},
   "outputs": [],
   "source": [
    "from lightgbm import LGBMRegressor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 264,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 269,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import ElasticNet, BayesianRidge"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 293,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.feature_selection import SelectFromModel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 294,
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline = Pipeline([\n",
    "    (\"scale\", StandardScaler()),\n",
    "    (\"transform\", QuantileTransformer(n_quantiles=2000)),\n",
    "#     (\"select\", SelectFromModel(estimator=ExtraTreesRegressor())),\n",
    "    (\"pca\", PCA(n_components=30)),\n",
    "    (\"ica\", FastICA(n_components=15)),\n",
    "#     (\"regressor\", LGBMRegressor(normali2ze=True)),\n",
    "    (\"regressor\", BayesianRidge(normalize=True)),\n",
    "])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 295,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (217). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\decomposition\\_fastica.py:120: ConvergenceWarning: FastICA did not converge. Consider increasing tolerance or the maximum number of iterations.\n",
      "  ConvergenceWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.08076621349631641"
      ]
     },
     "execution_count": 295,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipeline.fit(X_train, y_train)\n",
    "pipeline.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 296,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = pipeline.predict(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 299,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import cross_val_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 297,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pylab as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 306,
   "metadata": {},
   "outputs": [],
   "source": [
    "cv = KFold(n_splits=10, shuffle=True, random_state=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 307,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (292). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (292). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (292). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (292). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (292). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (293). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\decomposition\\_fastica.py:120: ConvergenceWarning: FastICA did not converge. Consider increasing tolerance or the maximum number of iterations.\n",
      "  ConvergenceWarning)\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (293). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (293). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (293). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n",
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (293). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([ 0.21045112,  0.03269815, -0.04535003,  0.09736183,  0.20442371,\n",
       "        0.23811152, -0.03937034,  0.27178148,  0.15372001,  0.09015468])"
      ]
     },
     "execution_count": 307,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cross_val_score(pipeline, X, y, cv=cv)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 308,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.12139821277330123"
      ]
     },
     "execution_count": 308,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 309,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py:2370: UserWarning: n_quantiles (2000) is greater than the total number of samples (325). n_quantiles is set to n_samples.\n",
      "  % (self.n_quantiles, n_samples))\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "Pipeline(steps=[('scale', StandardScaler()),\n",
       "                ('transform', QuantileTransformer(n_quantiles=2000)),\n",
       "                ('select', SelectFromModel(estimator=ExtraTreesRegressor())),\n",
       "                ('pca', PCA(n_components=30)),\n",
       "                ('ica', FastICA(n_components=15)),\n",
       "                ('regressor', BayesianRidge(normalize=True))])"
      ]
     },
     "execution_count": 309,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pipeline.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 310,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = pipeline.predict(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 311,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1f780e7d248>"
      ]
     },
     "execution_count": 311,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAqd0lEQVR4nO2df5BdZ3nfv89eHdu7DmhlpBRYLIvQICdCWEILmDoTLDeDjI2VxQIcF4chJfWENGkxzA524kFy8NRiVIKnJcF1qetJmQphy2yl2lTtxE6dGuywYiWECGIwBttLWgvsVYK0tu/uPv3j3rO6e+77vuc99557znvufj8zGkn3nj3nuT/2eZ/zfZ8foqoghBBSfQbKNoAQQkg+0KETQkifQIdOCCF9Ah06IYT0CXTohBDSJ6wo68KrV6/WdevWlXV5QgipJIcPH/6pqq4xPVeaQ1+3bh0mJyfLujwhhFQSEfmx7TlKLoQQ0ifQoRNCSJ9Ah04IIX0CHTohhPQJdOiEENInlJblQgipJhNT09hz6AR+MjOL1w4PYnzbeoxtHinbLAI6dEJIBiampnHLA8cwW58HAEzPzOKWB44BAJ16AFByIYR4s+fQiUVnHjNbn8eeQydKsoi0QodOCPHmJzOzmR4nxUKHTgjx5rXDg5keJ8VCh04I8WZ823oMRrUljw1GNYxvW1+S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fqFqvpgAfZ42QTgjQDeKCKPicjjInJlIHbtAnBDs9f+Q2g4h7LJ+t0rmqK+66mIyAiA9wL4Qtm2JHgjgFUi8lciclhEPlS2QQA+D+BX0AhajgH416q6kOcF8phYVDoicgOAUQDvDMCWAQB/CuDDJZuSZAUassvlaER3j4rIRlWdKdMoANcDuFdVPysi7wDwX0TkTXl/0fsFEdmKhkP/tbJtaXIngE+q6kIj8AyGFQC2APinAAYBfENEHlfV75do0zYARwBcAeANAP6XiPy1qv59XhcI2aF7zSoVkd8A8McA3qmqLwVg1ysAvAnAXzW/4K8GcEBEtqvqZEk2AY0o8wlVrQN4SkS+j4aD/2aPbPK16yMArgQAVf2GiJyHRiOjwm7fDQQ5J1dE3gzgiwDerao/K9ueJqMAvtz8rq8GcJWIzKnqRKlWNb7vP1PV0wBOi8ijAC4BUKZD/x0Au7Uhov9ARJ4CcDGAv8nrAiFLLt8E8Msi8noROQfAb6Exv3QREdkM4D8A2F6QJpxql6qeUtXVqrpOVdehoXf20pmn2tRkAo3oHCKyGo1b0h/20CZfu55GI4qCiPwKgPMAnOyxXWkcAPChZrbLpQhgTq6IrAXwAIDfLjnKXIKqvr7lu34/gN8PwJkDwH8D8GsiskJEhtCYd/y3JdvU+l3/RwDWI+ffwWAjdFWdE5E/AHAIjV30e1T1uIj8CYBJVT0AYA8amwv3NSOEp1V1ewB2FYqnTYcAvEtEvgtgHsB4r6M8T7s+AeA/ishNaGwafbgZwfQMCXBOrodNnwLwKgB/3vyuz2kB3fs87CqFNLtU9W9F5H8A+DaABQBfVFVn6mWvbUIjUeJeETmGRgbVJ1U111a/LP0nhJA+IWTJhRBCSAbo0AkhpE+gQyeEkD6BDp0QQvoEOnRCCOkT6NAJIaRPoEMnhJA+4f8DDFgKJrCwizgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(y, y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 315,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import r2_score, mean_squared_error, median_absolute_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 314,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.2551673906107038"
      ]
     },
     "execution_count": 314,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 298,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1f780e70e48>"
      ]
     },
     "execution_count": 298,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZMElEQVR4nO3db4xcV3nH8e+TZVM2tGQDNi3ZsDio4AANqZOloBpRJ63k/GmJgbyoS4lAIEv9QwtqrTgVxaG8iCO/QSiCyCDLSmkNVWLc0EBdqU5rNcFp13ISJyVGgRDHG6hNHKdqsoC9fvpidpP17L1z78zcP+ee+/tICHtm4jl3Pf7dM899zrnm7oiISPOdU/cARESkGAp0EZFIKNBFRCKhQBcRiYQCXUQkEq+o642XLVvmK1asqOvtRUQa6cCBAz9x9+VJz9UW6CtWrGB6erqutxcRaSQzeyrtOZVcREQioUAXEYmEAl1EJBIKdBGRSCjQRUQiUVuXi4j0Z/fBGbbuOcwzJ2e5cHyMjWtXsm7VRN3DkoAo0EUaYPfBGW7edYjZU3MAzJyc5eZdhwAU6vISlVxEGmDrnsMvhfmC2VNzbN1zuKYRSYgU6CIN8MzJ2b4el3ZSoIs0wIXjY309Lu2kQBdpgI1rVzI2OnLWY2OjI2xcu7KmEUm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L5h9b7GPA1QDu/h0zeyWdDXca8XWwhzzH3lhm9g7gK8A17v5s3eMp0BTwtc63d5YB15rZaXffXeuoinEUeNbdXwBeMLN9wGXA9+od1tA+CmzxThH9CTN7ErgE+M+i36jtM83/At5sZheb2bnA7wP3dL3mCPDbAGb2VuCVwPFKR1mOe4Ab57td3g087+4/qntQRTCzSWAX8GF3b3oYnMXdL3b3Fe6+ArgL+ONIwhzgH4H3mNkrzOw84F3Ad2seUxEWZ8gvAyuBH5TxRq2eobv7aTP7U2APnc6B7e7+mJn9DTDt7vcAfwF82cw+Refixkfmz7RBM7OdwBpg2Xz9fzMwCuDud9C5HnAt8ATwIp1ZRCPkOLbPAK8Fvjg/kz3tDdnNL8exNVbWsbn7d83sn4FHgDPAV9y9Z/tmCHL8nX0O2GFmh+h0ld3k7qVsF6yl/yIikWh7yUVEJBoKdBGRSCjQRUQioUAXEYmEAl1EJBIKdBGRSCjQRUQi8f9uPCzLWHN6EQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(y_test, y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 248,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[1;31mInit signature:\u001b[0m\n",
       "\u001b[0mQuantileTransformer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[1;33m*\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0mn_quantiles\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1000\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0moutput_distribution\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'uniform'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0mignore_implicit_zeros\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0msubsample\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m100000\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0mrandom_state\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m    \u001b[0mcopy\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\n",
       "\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
       "\u001b[1;31mDocstring:\u001b[0m     \n",
       "Transform features using quantiles information.\n",
       "\n",
       "This method transforms the features to follow a uniform or a normal\n",
       "distribution. Therefore, for a given feature, this transformation tends\n",
       "to spread out the most frequent values. It also reduces the impact of\n",
       "(marginal) outliers: this is therefore a robust preprocessing scheme.\n",
       "\n",
       "The transformation is applied on each feature independently. First an\n",
       "estimate of the cumulative distribution function of a feature is\n",
       "used to map the original values to a uniform distribution. The obtained\n",
       "values are then mapped to the desired output distribution using the\n",
       "associated quantile function. Features values of new/unseen data that fall\n",
       "below or above the fitted range will be mapped to the bounds of the output\n",
       "distribution. Note that this transform is non-linear. It may distort linear\n",
       "correlations between variables measured at the same scale but renders\n",
       "variables measured at different scales more directly comparable.\n",
       "\n",
       "Read more in the :ref:`User Guide <preprocessing_transformer>`.\n",
       "\n",
       ".. versionadded:: 0.19\n",
       "\n",
       "Parameters\n",
       "----------\n",
       "n_quantiles : int, optional (default=1000 or n_samples)\n",
       "    Number of quantiles to be computed. It corresponds to the number\n",
       "    of landmarks used to discretize the cumulative distribution function.\n",
       "    If n_quantiles is larger than the number of samples, n_quantiles is set\n",
       "    to the number of samples as a larger number of quantiles does not give\n",
       "    a better approximation of the cumulative distribution function\n",
       "    estimator.\n",
       "\n",
       "output_distribution : str, optional (default='uniform')\n",
       "    Marginal distribution for the transformed data. The choices are\n",
       "    'uniform' (default) or 'normal'.\n",
       "\n",
       "ignore_implicit_zeros : bool, optional (default=False)\n",
       "    Only applies to sparse matrices. If True, the sparse entries of the\n",
       "    matrix are discarded to compute the quantile statistics. If False,\n",
       "    these entries are treated as zeros.\n",
       "\n",
       "subsample : int, optional (default=1e5)\n",
       "    Maximum number of samples used to estimate the quantiles for\n",
       "    computational efficiency. Note that the subsampling procedure may\n",
       "    differ for value-identical sparse and dense matrices.\n",
       "\n",
       "random_state : int, RandomState instance or None, optional (default=None)\n",
       "    Determines random number generation for subsampling and smoothing\n",
       "    noise.\n",
       "    Please see ``subsample`` for more details.\n",
       "    Pass an int for reproducible results across multiple function calls.\n",
       "    See :term:`Glossary <random_state>`\n",
       "\n",
       "copy : boolean, optional, (default=True)\n",
       "    Set to False to perform inplace transformation and avoid a copy (if the\n",
       "    input is already a numpy array).\n",
       "\n",
       "Attributes\n",
       "----------\n",
       "n_quantiles_ : integer\n",
       "    The actual number of quantiles used to discretize the cumulative\n",
       "    distribution function.\n",
       "\n",
       "quantiles_ : ndarray, shape (n_quantiles, n_features)\n",
       "    The values corresponding the quantiles of reference.\n",
       "\n",
       "references_ : ndarray, shape(n_quantiles, )\n",
       "    Quantiles of references.\n",
       "\n",
       "Examples\n",
       "--------\n",
       ">>> import numpy as np\n",
       ">>> from sklearn.preprocessing import QuantileTransformer\n",
       ">>> rng = np.random.RandomState(0)\n",
       ">>> X = np.sort(rng.normal(loc=0.5, scale=0.25, size=(25, 1)), axis=0)\n",
       ">>> qt = QuantileTransformer(n_quantiles=10, random_state=0)\n",
       ">>> qt.fit_transform(X)\n",
       "array([...])\n",
       "\n",
       "See also\n",
       "--------\n",
       "quantile_transform : Equivalent function without the estimator API.\n",
       "PowerTransformer : Perform mapping to a normal distribution using a power\n",
       "    transform.\n",
       "StandardScaler : Perform standardization that is faster, but less robust\n",
       "    to outliers.\n",
       "RobustScaler : Perform robust standardization that removes the influence\n",
       "    of outliers but does not put outliers and inliers on the same scale.\n",
       "\n",
       "Notes\n",
       "-----\n",
       "NaNs are treated as missing values: disregarded in fit, and maintained in\n",
       "transform.\n",
       "\n",
       "For a comparison of the different scalers, transformers, and normalizers,\n",
       "see :ref:`examples/preprocessing/plot_all_scaling.py\n",
       "<sphx_glr_auto_examples_preprocessing_plot_all_scaling.py>`.\n",
       "\u001b[1;31mFile:\u001b[0m           c:\\software\\miniconda3\\lib\\site-packages\\sklearn\\preprocessing\\_data.py\n",
       "\u001b[1;31mType:\u001b[0m           type\n",
       "\u001b[1;31mSubclasses:\u001b[0m     \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "QuantileTransformer?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
